package com.kuzan.autocloud.common.model.report;


import com.kuzan.autocloud.common.model.Base;
import lombok.Data;
import lombok.NoArgsConstructor;

import javax.persistence.Column;
import javax.persistence.Entity;
import javax.persistence.Lob;
import javax.persistence.Table;

/**
 * <p>Description: </p>
 *
 * @author kuzank
 */
@Data
@NoArgsConstructor
@Entity
@Table(name = "sys_report_button")
public class ReportButton extends Base {

    /**
     * 所属报表
     */
    @Column(length = 32)
    private String report;
    /**
     * 脚本内容
     */
    @Lob
    @Column(columnDefinition = "TEXT")
    private String script;
    /**
     * 位置:工具栏,行
     */
    @Column(length = 32)
    private String position;
    /**
     * 图标
     */
    private String icon;
    /**
     * 需要选中
     */
    @Column(columnDefinition = "bit(1) default 0")
    private boolean needcheck;
    /**
     * 是否需要确认
     */
    @Column(columnDefinition = "bit(1) default 0")
    private boolean needconfirm;
    /**
     * 确认内容
     */
    private String confirmtext;


    /**
     * 报表按钮位置
     */
    public enum ReportButtonPosition {
        pid("rbp"),

        Toolbar("rbp_toolbar"),
        Row("rbp_row");

        private String name;

        ReportButtonPosition(String name) {
            this.name = name;
        }

        public String value() {
            return name;
        }

        public String getName() {
            return name;
        }
    }

}
